#include<bits/stdc++.h>

using namespace std;

int getS(int score) {
    return score > 21 ? 0 : score;
}

int dfs(int number, int n) {
    if (n == 0) return number;
    int t1 = dfs(getS(number + 11), n - 1);
    int t2 = dfs(getS(number + 1), n - 1);
    return max(t1, t2);
}

int main() {
    int n, m;
    int host, guest;
    int sum_1, sum_2;
    string t;
    while (cin >> n >> m) {
        host = guest = 0;
        sum_1 = sum_2 = 0;
        while (n--) {
            cin >> t;
            if (isdigit(t[0])) {
                if (t[0] == '1') host += 10;
                else {
                    host += t[0] - '0';
                }
                host = getS(host);

            } else if (t[0] == 'A') {
                sum_1++;
            } else host = getS(host + 10);
        }

        host = dfs(host, sum_1);
        while (m--) {
            cin >> t;
            if (isdigit(t[0])) {
                if (t[0] == '1') {
                    guest += 10;
                } else {
                    guest += t[0] - '0';
                }
                guest = getS(guest);
            } else if (t[0] == 'A') {
                sum_2++;
            } else guest = getS(guest + 10);
        }
        guest = dfs(guest, sum_2);
        cout << host << " vs " << guest;
        if (guest > host) {
            cout << " GUEST WIN\n";
        } else cout << " HOST WIN\n";
    }

    return 0;
}